﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using RBAC.Web.Service;
using RBAC.Web.Models;
namespace RBAC.Web.Mapper
{
    public class DomainMapper
    {
        public static DomainModel DtoToModel(DomainDto inputDto)
        {
            DomainModel result = new DomainModel();

            result.Id = inputDto.Id;
            result.DomainName = inputDto.DomainName;
            result.Description = inputDto.Description;

            result.CreateDate = inputDto.CreateDate;
            result.CreateById = inputDto.CreateById;
            //result.DomainStatus = inputDto.IsActive.GetValueOrDefault() ? 1 : 0;

            return result;
        }


        public static DomainDto ModelToDto(DomainModel inputModel)
        {


            DomainDto result = new DomainDto();

            result.Id = inputModel.Id;
            result.DomainName = inputModel.DomainName;
            result.Description = inputModel.Description;

            result.CreateDate = inputModel.CreateDate;
            result.CreateById = inputModel.CreateById ;
            //result.IsActive = inputModel.D == 1;

            return result;
        }

    }
}